﻿using MyProject.Models.ResponseModel;
using MyProject.Models.UserInfoModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace MyProject.Controllers.WebApi
{
    public class DemoApiController : ApiController
    {
        [HttpGet]
        public string Send([FromUri]string name)
        {
            return name;
        }

        [HttpPost]
        public HttpResponseMessage AddUserInfo([FromBody]List<UserInfoModel> userInfo)
        {           
            ResponseDataModel<List<UserInfoModel>> responseModel = new ResponseDataModel<List<UserInfoModel>>();

            responseModel.data = userInfo;
            responseModel.errorCode = 0;

            return this.Request.CreateResponse(HttpStatusCode.OK, responseModel);
        }


    }
}
